{% extends 'adminbase.html' %}
{% block content_admin %}
	
	Updating Photo :

	{% if photo %}
		{{ photo.title }} [<a href="/admin/admin_detailphoto/{{photo.pk}}/">View</a>]
		
		<form action="/admin/admin_updatephoto/{{photo.pk}}/" method="post">
		    <table>
		    {{form.as_table}}
		    </table>
		    <input type="submit" value="submit">
		</form>
		
	{% else %}
	    <p>No photo found.</p>
	{% endif %}

{% endblock %}

{% block content_admin_menu %}

	{% if photo %}
		<h3>Slideshow</h3>
		<form action="/admin/admin_updatelink_photoslideshow/{{photo.pk}}/" method="post">
			<input type="hidden"  name="photo_pk"  value="{{photo.pk}}">
			<input type="hidden"  name="return_url"  value="/admin/admin_updatephoto/{{photo.pk}}/">
			<SELECT name="selected_slideshow">
		        {% for slideshow in slideshow_list %}
					<OPTION VALUE="{{ slideshow.pk }}">{{ slideshow.title }}</OPTION>
			    {% endfor %}
			</SELECT>
			<INPUT type="submit" value="Add">
		</form>
		
		{% for slideshowLink in slideshow_linked_list %}
		<div class="page-list-item">
			[<a title="Remove" class="page-list-item-action-remove"
				href="/admin/admin_deletelink_photoslideshow/{{slideshowLink.pk}}/
							?return_url=/admin/admin_updatephoto/{{photo.pk}}/">-</a>]
			<a class="page-list-item-link" href="/admin/admin_detailslideshow/{{slideshowLink.slideshow.pk}}/">{{ slideshowLink.slideshow.title }}</a>
		</div>
	    {% endfor %}
    {% endif %}
{% endblock %}